<?php
class Mwc_SystemPoint_Model_Expire extends Mage_Core_Model_Abstract{
    protected function _construct(){
        $this->_init('systempoint/expire');
    }

    public function getExpireId(){
        return $this->getId();
    }
    
	public function getPercentByNoDay($days){
		//$model = Mage::getModel('systempoint/membership');
        $per = $this->getCollection()->addFieldToFilter('number_of_days', array('lteq' => $days))->setPageSize(1);
        $pnt[]='';
	    foreach($per as $item){    
            $pnt['number_of_days'] = $item->getNumberOfDays();
            $pnt['percent_lose'] = $item->getPercentLose();
        }
        return $pnt;
	}
}